package com.proposition.support.config;

import org.springframework.boot.context.embedded.ConfigurableEmbeddedServletContainer;
import org.springframework.boot.context.embedded.EmbeddedServletContainerCustomizer;
import org.springframework.boot.web.servlet.ErrorPage;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.HttpStatus;

/**
 * ${DESCRIPTION}
 *
 * @author 杨凯
 * @create 2017-10-30 11:04
 **/
@Configuration
public class ErrorPageConfig implements EmbeddedServletContainerCustomizer {


	@Override
	public void customize(ConfigurableEmbeddedServletContainer container) {
		container.addErrorPages(new ErrorPage(HttpStatus.NOT_FOUND, "/404"));
		container.addErrorPages(new ErrorPage(HttpStatus.INTERNAL_SERVER_ERROR, "/500"));
		container.addErrorPages(new ErrorPage(HttpStatus.FORBIDDEN, "/403"));
	}
}
